From: Tim Starling Date: Sun, 20 Mar 2005 02:37:08 +0000 (+0000) Subject: Making Special:Specialpages less ugly: sorting and changing categorisation style X-Git-Tag: 1.5.0alpha1~570 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=97fdc1382ea35943222fab00d9c3ad85835f8ad3;p=lhc%2Fweb%2Fwiklou.git Making Special:Specialpages less ugly: sorting and changing categorisation style --- diff --git a/includes/SpecialSpecialpages.php b/includes/SpecialSpecialpages.php index 677ed31b3a..f14f4f3d88 100644 --- a/includes/SpecialSpecialpages.php +++ b/includes/SpecialSpecialpages.php @@ -14,41 +14,24 @@ function wfSpecialSpecialpages() { $wgOut->setRobotpolicy( 'index,nofollow' ); $sk = $wgUser->getSkin(); - # Get listable pages + # Get listable pages, in a 2-d array with the first dimension being user right $pages = SpecialPage::getPages(); - /** pages available to all */ + /** Pages available to all */ wfSpecialSpecialpages_gen($pages[''],'spheading',$sk); - /** show pages splitted by user rights */ + /** Restricted special pages */ + $rpages = array(); foreach($wgAvailableRights as $right) { /** only show pages a user can access */ if( $wgUser->isAllowed($right) ) { /** some rights might not have any special page associated */ if(isset($pages[$right])) { - wfSpecialSpecialpages_gen($pages[$right], $right.'pheading', $sk); + $rpages = array_merge( $rpages, $pages[$right] ); } } - - } - -/** FIXME : spheading, sysopspheading, developerspheading need to be removed -from language files [av] */ -/** - # all users special pages - wfSpecialSpecialpages_gen($pages[''],'spheading',$sk); - - # sysops only special pages - if ( $wgUser->isSysop() ) { - wfSpecialSpecialpages_gen($pages['sysop'],'sysopspheading',$sk); - } - - # developers only special pages - if ( $wgUser->isDeveloper() ) { - wfSpecialSpecialpages_gen($pages['developer'],'developerspheading',$sk); - } -*/ + wfSpecialSpecialpages_gen( $rpages, 'restrictedpheading', $sk ); } /** @@ -60,12 +43,21 @@ from language files [av] */ function wfSpecialSpecialpages_gen($pages,$heading,$sk) { global $wgLang, $wgOut; - $wgOut->addHTML( '

' . wfMsg( $heading ) . "

\n